<extend name="Extends/base"/>
<block name="title">登陆</block>
<block name="css">
    <link rel="stylesheet" href="__CST__/css/login.css?v={:C('JS_CSS_VERSION')}" type="text/css"/>
</block>
<block name="body_style"></block>
<block name="body">
    <div class="login-wrap login-wrap-small login-wrap-fixed">
        <div class="login-tit clearfix login-tit-mail">信鸽管理后台</div>
        <div class="login clearfix">
            <div class="signin-area">
                <div class="signin-area-bg">
                    <div class="padder">
                        <form id='myForm'>
                            <div class="input-boxer clearfix">
                                <span class="fl mr10"><i class="icon iconfont icon-gerenzhongxin"></i></span>
                                <input type="text" name="phone" value="" placeholder="请输入手机号">
                            </div>
                            <div class="input-boxer clearfix mt20 mb10">
                                <span class="fl mr10"><i class="icon iconfont icon-bianji"></i></span>
                                <input type="password" name="pwd" value="" placeholder="请输入密码">
                            </div>
                            <div class="remember-password clearfix mb20">
                                <input type="hidden" name="saveLoginInfo" value='0'>
                                <div data-tname="saveLoginInfo" 
                                     class="gou_boxer fl">
                                    <i class="icon-chkbox"></i>下次自动登录
                                </div>
                                <!--<a href="javascript:;" class="fr forget">忘记密码？</a>-->
                            </div>
                        </form>
                        <div class="sign-input-a">
                            <a href="javascript:;" class="login-btn c-btn-blue c-btn-full c-btn-rounded">登录</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</block>
<block name="js">
    <script type="text/javascript">
        $(function () {
            if ($(window).height() > 460) {
                $('.login-wrap').addClass('login-wrap-fixed');
            }

            $(window).resize(function () {
                if ($(window).height() > 460) {
                    $('.login-wrap').addClass('login-wrap-fixed');
                } else {
                    $('.login-wrap').removeClass('login-wrap-fixed');
                }
            });
        });

        $('.login-btn').on('click', function () {
            var data = getFormData();
            var phone = data.phone;
            var pwd = data.pwd;

            if (!phone) {
                $.toast("登陆手机不能为空");
                return false;
            }

            if (!pwd) {
                $.toast("密码不能为空");
                return false;
            }

            doLogin(data, function (res) {
                if (res.Code != 10000) {
                    $.toast(res.Message);
                    return false;
                }
                var url = $.sUrl("/");
                location.href = url;
            });

        });

        //页面尺寸调整


        //忘记密码弹窗
        $(".forget").on("click", function () {
            art.dialog({
                lock: true,
                artIcon: 'ask',
                opacity: 0.4,
                width: 300,
                title: '温馨提示',
                content: '忘记密码请联系管理员<br/>电话：0591-237423<br/>QQ：3423423<br/>邮箱：sdfk@222.com',
                ok: function () {
                }
            });
        });

        $('.gou_boxer').on('click', function () {
            $(this).find('i.icon-chkbox').toggleClass('checked');
            var val = $(this).find('i.icon-chkbox').hasClass("checked") ? 1 : 0;
            var tname = $(this).attr("data-tname");
            if (tname) {
                $("#myForm input[name=" + tname + "]").val(val);
            }
        });
    </script>
</block>
<block name="jsFile">
    <script type="text/javascript" src="__CST__/js/api.js?v={:C('JS_CSS_VERSION')}"></script>
    <script type="text/javascript" src="__CST__/js/login.api.js?v={:C('JS_CSS_VERSION')}"></script>
</block>